<?php
require_once realpath(dirname(__FILE__)) . '//..//..//pages.php';
require_once CLASS_RECORD;

/**
 * Description of LavoraIn
 *
 * @author Andrea Cantafio
 */
class LavoraIn extends Record {

    public function __construct ($values) {
        $data = array ();
        if (is_array ($values)) {
            foreach ($values as $key => $value) {
                $add = true;
                switch ($key) {
                    case 'ID':
                        $key = 'IDdocente';
                        break;
                    case 'IDscuola':
                        break;
                    default:
                        $add = false;
                }
                if ($add) {
                    $data[$key] = $value;
                }
            }
        }
        $this->required = array ('IDdocente', 'IDscuola');
        parent::__construct ('lavora_in', $data);
    }

    public function delete ($where = null) {
        if (!isset ($where) || empty($where)) {
            $where = 'lavora_in.IDdocente=' . $this->values['IDdocente'];
        }
        parent::delete ($where);
    }
}

?>